<template>
  <TbTitle level="2" title="（四）举办刊物及公益活动" />
  <div>
    <table border="0" class="m-table-pdf">
      <tr>
        <td class="td-head">举办刊物情况</td>
        <td>公开发行的刊物数</td>
        <td style="width: 150px;">{{ tableData1.iiPublicationNum }}</td>
        <td>内部资料性刊物数</td>
        <td style="width: 150px;">{{ tableData1.publicationNum }}</td>
      </tr>
      <tr>
        <td class="td-head">公益活动</td>
        <td>举办次数</td>
        <td>{{ tableData1.publicationNum }}</td>
        <td>公益活动支出(万元)</td>
        <td>{{ tableData1.publicActivitiesNum }}</td>
      </tr>
    </table>
  </div>

  <div>
    <TbTitle level="2" title="（五）举办研讨会、论坛活动情况" />
    <el-table v-if="yes1" size="mini" :header-cell-style="{ background: '#f0f7fc', color: '#000' }" :data="tableData2"
      border>
      <el-table-column type="index" align="center" width="70" label="序号">
      </el-table-column>
      <el-table-column prop="activityName" align="center" label="活动名称">
      </el-table-column>
      <el-table-column prop="participateNum" align="center" label="参加人数">
      </el-table-column>
      <el-table-column prop="organizingMethod" align="center" label="举办方式">
      </el-table-column>
      <el-table-column prop="address" align="center" label="地点">
      </el-table-column>
      <el-table-column prop="fundingSource" align="center" label="经费来源">
      </el-table-column>
    </el-table>

    <el-descriptions title="" :column="3" border v-else>
      <el-descriptions-item label="本年度是否开展活动">
        <el-switch inline-prompt v-model="yes1" disabled active-text="已开展" inactive-text="未开展"> </el-switch>
      </el-descriptions-item>
    </el-descriptions>
  </div>

  <div>
    <TbTitle level="2" title="（六）举办评比达标表彰情况" />

    <el-table v-if="yes2" size="mini" :header-cell-style="{ background: '#f0f7fc', color: '#000' }" :data="tableData3"
      border>
      <el-table-column type="index" align="center" width="70" label="序号">
      </el-table-column>
      <el-table-column prop="activityName" align="center" label="活动名称">
      </el-table-column>
      <el-table-column prop="holdingTime" align="center" label="举办时间">
      </el-table-column>
      <el-table-column prop="approvalAuthority" align="center" label="审批机关">
      </el-table-column>
      <el-table-column prop="approvalTime" align="center" label="审批时间">
      </el-table-column>
    </el-table>

    <el-descriptions title="" :column="2" border v-else>
      <el-descriptions-item label="本年度是否开展活动">
        <el-switch inline-prompt v-model="yes2" disabled active-text="已开展" inactive-text="未开展"> </el-switch>
      </el-descriptions-item>
    </el-descriptions>

  </div>
</template>

<script setup lang="ts">
import { ref, inject, reactive } from 'vue'
import TbTitle from '@/views/yearCheck/components/TbTitle.vue'
const yes1 = ref(false)
const yes2 = ref(false)
const tableData1 = ref({})
const tableData2 = ref([])
const tableData3 = ref([])
const { getDetailInfo } = inject('getDetailInfo')

getDetailInfo(13).then(res => {
  const { publicationActivity, evaluationList, workshopList } = res.data
  tableData1.value = publicationActivity
  tableData2.value = workshopList || []
  tableData3.value = evaluationList || []
  yes1.value = workshopList && workshopList.length > 0 ? true : false
  yes2.value = evaluationList && evaluationList.length > 0 ? true : false
})

</script>
<style lang="scss" scoped>
.msg-tip {
  padding: 20px 0;
  color: #000;

  font-family: '微软雅黑';
}
</style>
